﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Payroll.Biz.Legacy.Models
{
    public class SalariedClassification : IPaymentClassification
    {
        public decimal Salary { get; private set; }

        public SalariedClassification(decimal salary)
        {
            Salary = salary;
        }

        public decimal CalculatePay(Paycheck paycheck)
        {
            return Salary;
        }

        public override string ToString()
        {
            return $"{{{nameof(Salary)}=${Salary.ToString()}}}";
        }

        public override bool Equals(object obj)
        {
            return (obj is SalariedClassification classification) && (Salary == classification.Salary);
        }

        public override int GetHashCode()
        {
            return (-2024508965) + Salary.GetHashCode();
        }
    }
}
